package com.jzo2o.customer.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.jzo2o.common.utils.BeanUtils;
import com.jzo2o.common.utils.IdUtils;
import com.jzo2o.common.utils.StringUtils;
import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.service.BankAccountService;
import com.jzo2o.customer.mapper.BankAccountMapper;
import com.jzo2o.customer.model.domain.BankAccount;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * 银行账户(BankAccount)表服务实现类
 *
 * @author makejava
 * @since 2025-10-07 22:02:40
 */
@Service
public class BankAccountServiceImpl extends ServiceImpl<BankAccountMapper, BankAccount> implements BankAccountService {
    @Override
    public void updateBankAccountInfo(BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        BankAccount bean = BeanUtils.toBean(bankAccountUpsertReqDTO, BankAccount.class);
//        注意这里的super指的是ServiceImpl，
//        baseMapper里面没有saveOrUpdate方法，
//        所以要用super.saveOrUpdate
        super.saveOrUpdate(bean);

    }

    @Override
    public BankAccount getBankAccount(Long id) {
        return baseMapper.selectById(id);
    }

}
